package com.itheima.pattern.t3_prototype.demo3;

/**
 * 原型模式-浅克隆
 */
public class TestDemo {

    public static void main(String[] args) throws CloneNotSupportedException {
        // 1、创建原型对象
        Citation citation = new Citation();
        Student student = new Student();
        student.setName("张三");
        citation.setStudent(student);

        // 2、克隆奖状对象
        Citation citation1 = citation.clone();
        Student student1 = citation1.getStudent();
        student1.setName("李四");

        // 3、调用show方法展示
        citation.show();
        citation1.show();
    }
}
